import {download, post} from '@/utils/request'

/**
 * 创建试卷
 * @param data
 */
export function createPaper(data) {
  return post('/exam/api/paper/paper/create-paper', data)
}

/**
 * 试卷详情
 * @param data
 */
export function paperDetail(data) {
  return post('/exam/api/paper/paper/paper-detail', data)
}

/**
 * 题目详情
 * @param data
 */
export function quDetail(data) {
  return post('/exam/api/paper/paper/qu-detail', data)
}

/**
 * 填充答案
 * @param data
 */
export function fillAnswer(data) {
  return post('/exam/api/paper/paper/fill-answer', data)
}

/**
 * 交卷
 * @param data
 */
export function handExam(data) {
  return post('/exam/api/paper/paper/hand-exam', data)
}

/**
 * 试卷详情
 * @param data
 */
export function paperResult(data) {
  return post('/exam/api/paper/paper/paper-result', data)
}

/**
 * 错题训练
 * @param data
 */
export function training(data) {
  return post('/exam/api/paper/paper/training', data)
}


/**
 * 检查是否有进行中的考试
 * @returns {*}
 */
export function checkProcess() {
  return post('/exam/api/paper/paper/check-process', {})
}
/**
 * 申请考试
 * @param data
 */
export function applyExam(data) {
  return post('/exam/api/paper/paper/applyExam', data)
}

/**
 * 申请考试列表
 * @param data
 */
export function applyExamList(data) {
  return post('/exam/api/paper/paper/applyExamList', data)
}
/**
 * 修改审核
 * @param data
 */
export function updateApply(data) {
  return post('/exam/api/paper/paper/updateApply', data)
}
/**
 * 删除审核
 * @param data
 */
export function deleteApply(data) {
  return post('/exam/api/paper/paper/deleteApply', data)
}

/**
 * 导出表格
 * /exam/api/paper/paper/exportApplyExamList
 */
export function exportApplyExamList(data, fileName = '申请考试列表.xlsx') {
  return download('/exam/api/paper/paper/exportApplyExamList', data, fileName)
}

/**
 * 导出二维码
 * /exam/api/paper/paper/exportApplyExamQRZIP
 */
export function exportApplyExamQRZIP(data, fileName = '申请考试二维码.zip') {
  return download('/exam/api/paper/paper/exportApplyExamQRZIP', data, fileName)
}

/**
 * 导出试卷
 * /exam/api/paper/paper/exportExamResultZIP
 */
export function exportExamResultZIP(data, fileName = '考试结果.zip') {
  return download('/exam/api/paper/paper/exportExamResultZIP', data, fileName)
}

/**
 * 批量审批
 * /exam/api/paper/paper/updateApplyStatus
 */
export function updateApplyStatus(data) {
  return post('/exam/api/paper/paper/updateApplyStatus', data)
}
